import { useParams } from 'react-router-dom'
function WithRoute(MyComponent) {
    function NewComponent(props) {
        let params = useParams();
        return <MyComponent params={params} {...props}></MyComponent>
    }
    return  NewComponent;
}

export default WithRoute;